/*
 * @Author: sjr
 * @Date: 2021-02-02 07:53:04
 * @LastEditTime: 2021-02-02 07:57:26
 * @LastEditors: sjr
 * @Description: 描述
 * @FilePath: \leetcode\260.只出现一次的数字-iii.js
 */
/*
 * @lc app=leetcode.cn id=260 lang=javascript
 *
 * [260] 只出现一次的数字 III
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var singleNumber = function(nums) {
  nums.sort((a,b)=>(a-b))
  let res = []
  for(let i=0;i<nums.length;i+=2){
    if(nums[i]!==nums[i+1]){
      res.push(nums[i])
      i--
    }
  }
  return res
};
// @lc code=end

